package com.yuntongxun.ecdemo.voicechat.comman;

import android.util.Log;

import com.google.gson.Gson;
import com.yuntongxun.ecdemo.voicechat.bean.ConfChatJson;
import com.yuntongxun.ecdemo.voicechat.util.CommonUtils;

/**
 * description：
 * author：liucanwen on 16/12/11 12:32
 * email：liucanwen@baibu.la
 */
public class GroupChatContacts {

    /**
     * 是否是礼物json
     * @param json
     * @return
     */
    public static boolean isGroupChat(String json){

        if(!CommonUtils.isEmpty(json)){

            if(json.startsWith("[conf]")){
                return true;
            }
        }

        return false;

    }

    /**
     * 生成群聊聊天对话
     * @param roomNo
     * @return
     */
    public static String getConfContact(String roomNo, String confId){

        ConfChatJson confChatJson = new ConfChatJson();

        if(!CommonUtils.isEmpty(roomNo)) {
            confChatJson.setRoomNo(roomNo);
        }

        if(!CommonUtils.isEmpty(confId)){
            confChatJson.setConfId(confId);
        }

        String result = new Gson().toJson(confChatJson);

        Log.e("conf", result);

        return result;
    }

}
